<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link href="../static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
    <link href="../static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>用户登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <style>
        .headerarea {
            position: absolute;
            padding-left: 30px;
            color: aquamarine;
            z-index: 2;
        }

        .headlogo {
            position: relative;
            text-align: center;
        }

        .headlogo img {
            width: 100px;
            height: 100px;
            border-radius: 50px;
        }

        .loginarea {

            position: absolute;
            width: 330px;
            height: 388px;
            left: 50%;
            top: 50%;
            margin-left: -165px;
            margin-top: -250px;
            border-radius: 20px;
            background: rgb(214 214 214 / 30%);
            box-sizing: border-box;
            padding: 20px;
            box-shadow: 0 0 12px #7e7e7e;
        }

        .loginarea .cl {
            position: relative;
        }

        .loginarea .col-xs-8 {
            width: 100%;
        }

        .loginarea .input-text {
            padding-left: 50px;
            border-radius: 6px;
        }

        .loginarea .col-xs-3 {
            position: absolute;
            width: 40px;
            height: 40px;
            font-size: 24px;
            color: #989494;
            left: 10px;
        }

        .loginarea .col-xs-3 i {

            line-height: 40px;
        }

        .loginarea .col-xs-offset-3 {
            margin-left: 0;
        }

        .loginarea .inputsure {
            padding-left: 10px;
            width: 100px;
        }

        .loginarea .btn-success {
            color: #fff;
            background: #40a9ff;
            border-color: #40a9ff;
            width: 100%;
        }


        .loginWraperBack {
            position: absolute;
            width: 100%;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            z-index: 1;
        }

        .footerarea {
            height: 46px;
            line-height: 46px;
            bottom: 0;
            text-align: center;
            color: #b3b3b3;
            font-size: 12px;
            position: absolute;
            left: 0;
            right: 0;
            width: 100%;
            z-index: 99;
            border-top: 1px solid #a7a7a7;
            padding: 15px 0;
            font-family: tahoma, Arial;
        }
    </style>
</head>

<body>
    <input type="hidden" id="TenantId" name="TenantId" value="" />


    <div class="loginWraperBack">
        <div id="loginform" class="loginarea">
            <form class="form form-horizontal" id="fromlogin">

                <div class="row headlogo" style="font-size: 32px;text-align: left;margin-bottom: 60px;color:#676a6c;padding-left:10px;">
                    <span>项目模板</span>
                </div>

                <div class="row cl">
                    <!-- <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label> -->
                    <div class="formControls col-xs-8">
                        <input name="email" type="text" placeholder="账户" value="admin@plan.com" class="input-text size-L inputaccount">
                    </div>
                    <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                </div>
                <div class="row cl">
                    <!-- <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label> -->
                    <div class="formControls col-xs-8">
                        <input name="password" type="password" placeholder="密码" value="123456" class="input-text size-L inputpass">
                    </div>
                    <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                </div>


                <div class="row cl issms">
                    <div class="formControls col-xs-8 col-xs-offset-3" style="display:flex;">
                        <span class="spansms"><img class="imgcode"
                            style="width:110px;height:40px;border-radius:4px;" value=""></span>
                        <input class="input-text size-L inputsure" type="text" name="code" placeholder="验证码"
                            value="" style="width:174px;border-radius:4px;flex:1;">

                    </div>
                </div>

                <div class="row cl" style="display: none;">
                    <div class="formControls col-xs-8 col-xs-offset-3">
                        <input class="input-text size-L" type="text" name="guid" placeholder="批次号"
                            style="width:150px;">
                    </div>
                </div>

                <div class="row cl" style="display: none;">
                    <div class="formControls col-xs-8 col-xs-offset-3">
                        <input class="input-text size-L" type="text" name="loginway" value="img" placeholder="登录方式"
                            style="width:150px;">
                    </div>
                </div>


                <input style="display: none;" id="" name="game_id" type="text" placeholder="" value="0"
                    class="input-text size-L">

                <div class="row cl">
                    <div class="formControls col-xs-8 col-xs-offset-3">
                        <button type="button" onclick="_funclogin()"
                            class="btn btn-success radius size-L">&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;</button>
                        <!-- <button type="reset" class="btn btn-default radius size-L">&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;</button> -->
                    </div>
                </div>
            </form>

            <div class="loginafter">
                <div>
                    <a class="hrefvisit" dataurl="" onclick="_funcvisit();">进入系统</a>
                    <!-- <a class="hrefchange" href="change.html">修改密码</a> -->
                </div>
            </div>

        </div>
    </div>
    <div class="footerarea">- -- ---Copyright Template www.pastecode.cn @2023 --- -- -</div>
    <script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="../lib/api.js"></script>
    <script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
    <style>
        .loginafter {
            display: none;
            margin-top: 30px;
            text-align: center;
        }

        .loginafter .hrefvisit {
            font-size: 24px;
            text-decoration: none;
        }

        .loginafter .hrefchange {
            margin-left: 20px;
            cursor: pointer;
        }
    </style>

    <script>

        function randomString(len) {
            len = len || 32;
            var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
            var maxPos = $chars.length;
            var pwd = '';
            for (i = 0; i < len; i++) {
                pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
            }
            return pwd;
        }

        var tguid = "";

        var smsmodel = false;

        $(window).ready(function () {

            _imagechange();

            $(".inputsure").keyup(function (event) {
                if (event.keyCode == 13) {
                    _funclogin();
                }
            });

            $(".inputpass").keyup(function (event) {
                if (event.keyCode == 13) {
                    _funclogin();
                }
            });

            $(".inputaccount").keyup(function (event) {
                if (event.keyCode == 13) {
                    $(".inputpass").focus();
                }
            })
            $(".imgcode").on('click',function(){
                _imagechange();
            })

            var timertick = 0;

        });

        function _imagechange() {
             tguid = randomString(16);
             $("[name=guid]").val(tguid);
             $(".imgcode").attr("src", "/api/app/User/Image?guid=" + tguid);
             $("[name=code]").val('');
        }
        function _funclogin() {

            var dataobj = $("#fromlogin").parseForm();
            dataobj.smsmodel = smsmodel;
            _apipost("/api/app/User/Login", true, JSON.stringify(dataobj), function (code, obj) {
                if (code == 200) {

                    localStorage.setItem("webtoken", obj.token);
                    layer.msg("登录成功", { time: 1500 }, function () {
                        window.parent.location.replace("/page/index.html");
                    });
                } else {
                     _imagechange();
                     layer.msg(JSON.stringify(obj));
                }
            });

        }

    </script>
</body>

</html>